package com.itheima.reggie.common;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
public class BaseContext {
    private static ThreadLocal<Long> threadLocal =   new ThreadLocal<>();

    public static void setThreadLocal(Long id){

        threadLocal.set(id);
    }
    
    public static Long get(){
        //log.info("get方法中id:"+BaseContext.get());
        return threadLocal.get();
    }

    public static void reless(){
        threadLocal.remove();
    }
}
